 {

        var o = function () {
        };
        o.prototype = {
            allResCount: 0,
            allJpgCount: 0,
            allAtlas: [],
            ctor: function () {
                this.allResCount = 0, this.allJpgCount = 0, this.allAtlas = [], this.hasLoadGameAtlas = !1,
                    this._isLoadingGameSprite = !1, this.totalGameAtlasCount = 0, this.hasLoadGameAtlasCount = 0,
                    this.loadHomeSpriteAtlas(), this.loadGameAtlasCallback = null;
            },
            loadHomeSpriteAtlas: function () {
                this.doLoadSpriteAtlas("Texture/common");
            },
            setLoadGameSpriteAtlasCallback: function (e) {
                this.loadGameAtlasCallback = e;
            },
            loadGameSpriteAtlas: function () {
                if (console.log("loadGameSpriteAtlas 1:", this.hasLoadGameAtlas, this._isLoadingGameSprite),
                    this.hasLoadGameAtlas) return console.log("loadGameSpriteAtlas 2"), Global.notificationCenter.emit(Global.eventName.LOAD_GAME_RESOURCE_SUCCESS),
                    void (this.loadGameAtlasCallback && this.loadGameAtlasCallback());
                this._isLoadingGameSprite ? console.log("loadGameSpriteAtlas 3") : (console.log("loadGameSpriteAtlas 4"),
                    this._isLoadingGameSprite = !0, this.doLoadGameAtlas("Texture/table"), this.doLoadGameAtlas("Texture/mj_az_tiles"),
                    this.doLoadGameAtlas("Texture/mj_ad_tiles"), this.doLoadGameAtlas("Texture/mj_al_tiles"),
                    this.doLoadGameAtlas("Texture/mj_ar_tiles"));
            },
            doLoadGameAtlas: function (e) {
                this.totalGameAtlasCount++, cc.loader.loadRes(e, cc.SpriteAtlas, this.loadGameAtlasCallBack.bind(this, e));
            },
            loadGameAtlasCallBack: function (e, t, n) {
                null == t ? (this.allAtlas.push(n), this.hasLoadGameAtlasCount++, console.log("loadGameAtlasCallBack", this.hasLoadGameAtlasCount, this.totalGameAtlasCount),
                this.hasLoadGameAtlasCount >= this.totalGameAtlasCount && (this.hasLoadGameAtlas = !0,
                    Global.notificationCenter.emit(Global.eventName.LOAD_GAME_RESOURCE_SUCCESS), this.loadGameAtlasCallback && this.loadGameAtlasCallback(),
                tywx.IsWechatPlatform() && wx.hideLoading())) : console.error("SpriteAtlas doLoadSpriteAtlas error =", t.message);
            },
            getGameAtlasIsLoadOk: function () {
                return this.hasLoadGameAtlas || (this.loadGameSpriteAtlas(), tywx.IsWechatPlatform() && wx.showLoading({
                    title: "努力加载..."
                })), this.hasLoadGameAtlas;
            },
            doLoadSpriteAtlas: function (e) {
                this.allResCount++, cc.loader.loadRes(e, cc.SpriteAtlas, this.addToArray.bind(this, e));
            },
            doLoadJpg: function (e) {
                this.allResCount++, cc.loader.loadRes(e, cc.Texture2D, this.addToArray2.bind(this, e));
            },
            addToArray: function (e, t, n) {
                null == t ? this.allAtlas.push(n) : console.error("SpriteAtlas doLoadSpriteAtlas error =", t.message);
            },
            addToArray2: function (e, t, n) {
                null == t ? this.allJpgCount++ : console.error("SpriteAtlas doLoadJpg error =", t.message);
            },
            getSpriteFrame: function (e) {
                for (var t = null, n = this.allAtlas.length, o = 0; o < n; o++) if (t = this.allAtlas[o]) {
                    var i = t.getSpriteFrame(e);
                    if (i) return i;
                }
                return null;
            },
            setSpriteFrame: function (e, t, n) {
                if (e && t && n) try {
                    var o = this.getSpriteFrame(n);
                    if (o) e && cc.isValid(e) && (e.spriteFrame = o, e.enabled = !0); else {
                        var i = this;
                        cc.loader.loadRes(t, cc.SpriteAtlas, function (t, a) {
                            if (null != t) return console.error("SpriteAtlas loadGameAtlasCallBack error =", t.message),
                                null;
                            i.allAtlas.push(a), (o = i.getSpriteFrame(n)) ? e && cc.isValid(e) && (e.spriteFrame = o,
                                e.enabled = !0) : console.error("SpriteAtlas setSpriteFrame cannot find spriteFrame :", n);
                        });
                    }
                } catch (e) {
                    cc.error("SpriteAtlas setSpriteFrame", "catch error : " + e.stack);
                } else console.error("SpriteAtlas setSpriteFrame error sprite = " + e + " atlas = " + t + " spriteFrameName = " + n);
            },
            getLoadPercent: function () {
                return 100 * (this.allAtlas.length + this.allJpgCount) / this.allResCount;
            },
            getOKSpf: function () {
                return this.getSpriteFrame("TY_16");
            },
            getOKSpfYellow: function () {
                return this.getSpriteFrame("TY_12");
            },
            getCancelSpf: function () {
                return this.getSpriteFrame("TY_15");
            },
            getReconnectSpf: function () {
                return this.getSpriteFrame("TY_14");
            },
            getGoInviteSpf: function () {
                return this.getSpriteFrame("TY_11");
            },
            getQuickStartSpf: function () {
                return this.getSpriteFrame("TY_10");
            },
            getRetrySpf: function () {
                return this.getSpriteFrame("TY_13");
            },
            getNormalButton: function () {
                return this.getSpriteFrame("TY_ICON1");
            }
        },  module.exports = o
    }